package pl.com.like.sequoia.model.security;

import pl.com.like.sequoia.model.Pojo;

/**
 * Class which contains access information for selected user.
 * @author Pawel Wolanski
 *
 */
public class Authorization extends Pojo<Long> implements IAuthorization {

	private static final long serialVersionUID = 9086775406124968398L;

	/**
	 * user who is authorized to given component.
	 */
	IUser user;
	/**
	 * class name which is accessed for given user. 
	 */
	String clazz;
	
	/** {@inheritDoc} */
	public String getClazz() {
		return clazz;
	}

	/** {@inheritDoc} */
	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	/** {@inheritDoc} */
	public IUser getUser() {
		return user;
	}

	/** {@inheritDoc} */
	public void setUser(IUser user) {
		this.user = user;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString()
	{
	    final String TAB = "    ";
	    
	    String retValue = "";
	    
	    retValue = "Authorization ( "
	        + super.toString() + TAB
	        + "user = " + this.user + TAB
	        + "clazz = " + this.clazz + TAB
	        + " )";
	
	    return retValue;
	}

}
